/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "KEO_CHAU_A", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "KeoChauA.findAll", query = "SELECT k FROM KeoChauA k"),
    @NamedQuery(name = "KeoChauA.findById", query = "SELECT k FROM KeoChauA k WHERE k.id = :id"),
    @NamedQuery(name = "KeoChauA.findByChuAnMat", query = "SELECT k FROM KeoChauA k WHERE k.chuAnMat = :chuAnMat"),
    @NamedQuery(name = "KeoChauA.findByTyLeChap", query = "SELECT k FROM KeoChauA k WHERE k.tyLeChap = :tyLeChap"),
    @NamedQuery(name = "KeoChauA.findByKhachAnMat", query = "SELECT k FROM KeoChauA k WHERE k.khachAnMat = :khachAnMat"),
    @NamedQuery(name = "KeoChauA.findByGioCapNhatCuoi", query = "SELECT k FROM KeoChauA k WHERE k.gioCapNhatCuoi = :gioCapNhatCuoi"),
    @NamedQuery(name = "KeoChauA.findByThoiDiem", query = "SELECT k FROM KeoChauA k WHERE k.thoiDiem = :thoiDiem"),
    @NamedQuery(name = "KeoChauA.findByGioKhoiTao", query = "SELECT k FROM KeoChauA k WHERE k.gioKhoiTao = :gioKhoiTao"),
    @NamedQuery(name = "KeoChauA.findByNguonDuLieu", query = "SELECT k FROM KeoChauA k WHERE k.nguonDuLieu = :nguonDuLieu")})
public class KeoChauA implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Long id;
    @Column(name = "CHU_AN_MAT")
    private Double chuAnMat;
    @Size(max = 15)
    @Column(name = "TY_LE_CHAP")
    private String tyLeChap;
    @Column(name = "KHACH_AN_MAT")
    private Double khachAnMat;
    @Column(name = "GIO_CAP_NHAT_CUOI")
    @Temporal(TemporalType.TIMESTAMP)
    private Date gioCapNhatCuoi;
    @Size(max = 40)
    @Column(name = "THOI_DIEM")
    private String thoiDiem;
    @Column(name = "GIO_KHOI_TAO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date gioKhoiTao;
    @Size(max = 100)
    @Column(name = "NGUON_DU_LIEU")
    private String nguonDuLieu;
    @JoinColumn(name = "ID_TRAN_DAU", referencedColumnName = "ID")
    @ManyToOne
    private TranDau idTranDau;

    public KeoChauA() {
    }

    public KeoChauA(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Double getChuAnMat() {
        return chuAnMat;
    }

    public void setChuAnMat(Double chuAnMat) {
        this.chuAnMat = chuAnMat;
    }

    public String getTyLeChap() {
        return tyLeChap;
    }

    public void setTyLeChap(String tyLeChap) {
        this.tyLeChap = tyLeChap;
    }

    public Double getKhachAnMat() {
        return khachAnMat;
    }

    public void setKhachAnMat(Double khachAnMat) {
        this.khachAnMat = khachAnMat;
    }

    public Date getGioCapNhatCuoi() {
        return gioCapNhatCuoi;
    }

    public void setGioCapNhatCuoi(Date gioCapNhatCuoi) {
        this.gioCapNhatCuoi = gioCapNhatCuoi;
    }

    public String getThoiDiem() {
        return thoiDiem;
    }

    public void setThoiDiem(String thoiDiem) {
        this.thoiDiem = thoiDiem;
    }

    public Date getGioKhoiTao() {
        return gioKhoiTao;
    }

    public void setGioKhoiTao(Date gioKhoiTao) {
        this.gioKhoiTao = gioKhoiTao;
    }

    public String getNguonDuLieu() {
        return nguonDuLieu;
    }

    public void setNguonDuLieu(String nguonDuLieu) {
        this.nguonDuLieu = nguonDuLieu;
    }

    public TranDau getIdTranDau() {
        return idTranDau;
    }

    public void setIdTranDau(TranDau idTranDau) {
        this.idTranDau = idTranDau;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof KeoChauA)) {
            return false;
        }
        KeoChauA other = (KeoChauA) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.KeoChauA[ id=" + id + " ]";
    }
    
}
